package com.ms;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.cloud.config.server.environment.JdbcEnvironmentProperties;
import org.springframework.cloud.config.server.environment.JdbcEnvironmentRepository;
import org.springframework.cloud.config.server.environment.JdbcEnvironmentRepositoryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * <b>description</b>： <br>
 * <b>time</b>：2019/5/17 16:23 <br>
 * <b>author</b>：ready likun_557@163.com
 */
@Configuration
@Profile("msConfig")
public class MsRepositoryConfiguration {
    @Bean
    public MsEnvironmentRepository msEnvironmentRepository(JdbcTemplate jdbcTemplate,
                                                           JdbcEnvironmentProperties environmentProperties) {
        return new MsEnvironmentRepository(jdbcTemplate, environmentProperties);
    }
}
